package com.googlecode.lookie.platform.image.io;

import java.util.HashMap;
import java.util.Map;

import com.googlecode.lookie.platform.image.format.Format;

public class ReaderRegistry
{

    private Map<Format, Reader> readers = new HashMap<Format, Reader>();

    public void setReader( Format format, Reader reader )
    {
        if ( reader == null )
        {
            readers.remove( format );
        }
        else
        {
            readers.put( format, reader );
        }
    }

    public Reader getReader( Format format )
    {
        return readers.get( format );
    }

}
